
///////////////////////////////////////////////////////////
//  Models included in paper and appendix (JOP)          //
///////////////////////////////////////////////////////////


* For Figure 1 (see R code and output)

*Use "HarbridgeYong_Volden_Wiseman_House_Replication" Stata Dataset for following .do file

*FOR FIXED EFFECTS BY MEMBER
xtset icpsr

* Table 1 shows the effect of gaining bipartisan cosponsors
* Model 1.1: No controls
xtreg les mean_prop_cospon_opp_spon_HR, fe cluster(icpsr)
* Model 1.2: With standard control variables (and average number of cosponsors attracted)
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model 1.3: But being a bipartisan cosponsor does not help (directly)
xtreg les mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* TABLE 2: Robustness to evolving conditions across Congresses
* Model 2.1 (interaction with linear time trend)
xtreg les c.mean_prop_cospon_opp_spon_HR##c.time prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model 2.2 (interaction with majority seat margin)
xtreg les c.mean_prop_cospon_opp_spon_HR##c.majmargin prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model 2.3 (interaction for polarization, difference in party medians)
xtreg les c.mean_prop_cospon_opp_spon_HR##c.normptydiff prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Nonlinear models in Table 3
* Showing nonlinear effects, overall and then majority and minority party
* Model 3.1
xtreg les mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model 3.2
xtreg les mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if majority==1, fe cluster(icpsr)
* Model 3.3
xtreg les mean_prop_cospon_opp_spon_HR bipart_sq seniority min_leader power meddist deleg_size votepct votepct_sq mean_cospon_spon_HR if majority==0, fe cluster(icpsr)

*Table 4 shows the benefit of being a bipartisan cosponsor (Showing models with and without fixed effects for House and for Senate -- see Senate data file and do)
* Model 4.1: No fixed effects
reg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)
*Model 4.2: (Fixed) Effects on House
xtreg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Figure 2 (labels and descriptions added in PowerPoint and Word after generating this figure)
reg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)
quietly margins, atmeans at(meddist=(0(0.01)1) prop_co_bipart=(0(0.25)0.5))
marginsplot, x(meddist) scheme(s1manual) recast(line) recastci(rarea) ytitle("Proportion Bipartisan Cosponsors Attracted", size(medium)) xtitle("Distance from Median", size(medium)) title("", size(large)) plotregion(style(none))


* FOR APPENDIX

* Figures A1 and A2 constructed in R (see relevant code)

* Figure A3 is for Senate (see Senate data and code)

* For descriptive statistics, Table A1
sum les mean_prop_cospon_opp_spon_HR prop_co_bipart mean_cospon_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq majmargin if mean_prop_cospon_opp_spon_HR~=.

* Appendix Table A2
* Model A2.1: No controls
xtreg les mean_prop_cospon_opp_spon_HR_nc, fe cluster(icpsr)
* Model A2.2: With standard control variables
xtreg les mean_prop_cospon_opp_spon_HR_nc seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A2.3: But being a bipartisan cosponsor does not help (directly)
xtreg les mean_prop_cospon_opp_spon_HR_nc prop_co_bipart_nc seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR_nc, fe cluster(icpsr)

* Appendix Table A3
* Model A3.1: No controls
xtreg les normbipart, fe cluster(icpsr)
* Model A3.2: With standard control variables
xtreg les normbipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A3.3: But being a bipartisan cosponsor does not help (directly)
xtreg les normbipart prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A4
* Model A4.1 
xtreg les mean_prop_cospon_opp_spon_HR prop_spon_no_cospon seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A4.2, showing that the main results hold when we drop early Congresses with limitations on numbers of cosponsors
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress>95, fe cluster(icpsr)
* Model A4.3, and once the rise in cosponsorship levels out (about 60% of bills as of the 100th Congress)
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress>99, fe cluster(icpsr)

* Appendix Table A5
* Model A5.1 (Finding - bipartisan sponsorship (with alternative measure) boosts LES)
xtreg les prop_spon_bi_cospon seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A5.2, now doing the same things, but including all sponsored bills, not just those with positive number of cosponsorships
xtreg les prop_spon_bi_cospon_all seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A6
* Model A6.1
reg les mean_prop_cospon_opp_spon_HR, cluster(icpsr)
* Model A6.2
reg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)
* Model A6.3
reg les mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)

* Appendix Table A7
* For Model A7.1 
xtreg les c.mean_prop_cospon_opp_spon_HR##c.normvotepct prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A8 shows relevant stages in House (A9 for Senate)
* Model A8.1: Gaining bipartisan cosponsors does not affect introductions
xtreg all_bills mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A8.2: Action in committee
xtreg all_aic mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A8.3: Does affect percent reaching floor
xtreg all_abc mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A8.4: Passing the House
xtreg all_pass mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A8.5: Does substantially promote law production 
xtreg all_law mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A10
* Model A10.1
xtreg all_law mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Now excluding commemorative laws, Model A10.2
xtreg nonc_law mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Now only for S&S laws, Model A10.3
xtreg ss_law mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A11
* Model A11.1 (linear):
xtreg law_hhiker mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)
* Model A11.2 (nonlinear):
xtreg law_hhiker mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe cluster(icpsr)

* Appendix Table A12 (House -- A13 will be Senate)
* Model A12.1 Early linear
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress<104, fe cluster(icpsr)
* Model A12.2 Early nonlinear
xtreg les mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress<104, fe cluster(icpsr)
* Model A12.3 Later linear
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress>103, fe cluster(icpsr)
* Model A12.4 Later nonlinear
xtreg les mean_prop_cospon_opp_spon_HR bipart_sq seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if congress>103, fe cluster(icpsr)

* Appendix Table A14
* Model A14.1: No fixed effects
reg mean_prop_cospon_opp_spon_HR_nc prop_co_bipart_nc seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR_nc, cluster(icpsr)
*Model A14.2: (Fixed) Effects on House
xtreg mean_prop_cospon_opp_spon_HR_nc prop_co_bipart_nc seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR_nc, fe cluster(icpsr)

* Appendix Table A15, majority and minority party benefits of bipartisan cosponsorships
* Model A15.1 Majority party
xtreg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist deleg_size votepct votepct_sq mean_cospon_spon_HR if majority==1, fe cluster(icpsr)
* Model A15.2 Minority party
xtreg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority min_leader speaker power meddist deleg_size votepct votepct_sq mean_cospon_spon_HR if majority==0, fe cluster(icpsr)

* Appendix Table A16, across eras benefits of bipartisan cosponsorships
* Model A16.1 Early
xtreg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist deleg_size votepct votepct_sq mean_cospon_spon_HR if congress<104, fe cluster(icpsr)
* Model A16.2 Later
xtreg mean_prop_cospon_opp_spon_HR prop_co_bipart seniority majority maj_leader min_leader speaker chair subchr power meddist deleg_size votepct votepct_sq mean_cospon_spon_HR if congress>103, fe cluster(icpsr)


*** Robustness footnotes ***
*For footnote on count models (negative binomials)
xtnbreg all_bills mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe
xtnbreg all_aic mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe
xtnbreg all_abc mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe
xtnbreg all_pass mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe
xtnbreg all_law mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, fe

* For footnote on main findings for Democrats and Republicans
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if dem==1, fe cluster(icpsr)
xtreg les mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR if dem==0, fe cluster(icpsr)

*For footnote that additional results hold without fixed effects
reg all_bills mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)
reg all_abc mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)
reg all_law mean_prop_cospon_opp_spon_HR seniority majority maj_leader min_leader speaker chair subchr power meddist female afam latino deleg_size votepct votepct_sq mean_cospon_spon_HR, cluster(icpsr)

